<?php
declare (strict_types = 1);

namespace app\validate;

use think\Validate;

class LoginValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'username' => 'require|max:6',
        'password'=>'number|between:1,8',
        "captcha|验证码"=>'require|captcha',

    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
       'username.require' =>   '用户名必须',
       'username.max'     =>   '用户名最大长度为6',
        'password.number' =>  '密码必须为数字',
        'password.between'=>   '密码只能在1到8位',


    ];
}
